<?xml version="1.0"?>
<wfs:CreateStoredQuery
   xmlns:wfs="http://www.opengis.net/wfs/2.0"
   xmlns:fes="http://www.opengis.org/fes/2.0"
   xmlns:gml="http://www.opengis.net/gml/3.2"
   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
   xmlns:myns="http://www.someserver.com/myns"
   xsi:schemaLocation="http://www.opengis.net/wfs/2.0 ../../wfs.xsd"
   service="WFS"
   version="2.0.0">
   <wfs:StoredQueryDefinition id="urn:StoredQueries:FeaturesInPolygon">
      <wfs:Title>Features In Polygon</wfs:Title>
      <wfs:Abstract>Find all the features in a Polygon.</wfs:Abstract>
      <wfs:Parameter name="AreaOfInterest" type="gml:Polygon"/>
      <wfs:QueryExpressionText
           returnFeatureTypes="myns:Parks myns:Lakes myns:Rivers"
           language="urn:ogc:def:queryLanguage:OGC-WFS::WFS_QueryExpression"
           isPrivate="false">
         <wfs:Query typeNames="myns:Parks">
            <fes:Filter>
               <fes:Within>
                  <fes:ValueReference>geometry</fes:ValueReference>
                  ${AreaOfInterest}
               </fes:Within>
            </fes:Filter>
         </wfs:Query>
         <wfs:Query typeNames="myns:Lakes">
            <fes:Filter>
               <fes:Within>
                  <fes:ValueReference>region</fes:ValueReference>
                  ${AreaOfInterest}
               </fes:Within>
            </fes:Filter>
         </wfs:Query>
         <wfs:Query typeNames="myns:Rivers">
            <fes:Filter>
               <fes:Within>
                  <fes:ValueReference>region</fes:ValueReference>
                  ${AreaOfInterest}
               </fes:Within>
            </fes:Filter>
         </wfs:Query>
      </wfs:QueryExpressionText>
   </wfs:StoredQueryDefinition>
</wfs:CreateStoredQuery>
